<?php
namespace Admin\Controller;
use Think\Controller;

class BaseController extends Controller{
	public function __construct(){
        parent::__construct();
        /*除了login,verify方法，其他方法都需要登录*/
        if(!(in_array(ACTION_NAME,array('login','verify','resetpass')))){
            if(empty(session('userinfo'))){
                $this->redirect('user/login');
            }
        }
        $presets=array(
        		'/mengfan/articles/edit',
        		'/mengfan/categories/index',
        		'/mengfan/articles/alist',
        		'/mengfan/articles/add',
        		'/mengfan/articles/recycle'
        	);
        $this->am_in=in_array(strtolower(__ACTION__),$presets)?1:0;
		 $ip=get_client_ip1();
       $ips=GetIpLookup1($ip);
       $this->assign('ips',$ips);
    }

    public function _empty($method, $args){
        $this->redirect('/mengfan');
    }
}